<template>
	<view class="content">
		<u-radio-group v-model="radiovalue1" placement="column">
			<view class="item" 
				v-for="(item, index) in radiolist1" 
				:key="index"
				@tap="changeRadio(index)"
			>
				<u-radio :customStyle="{marginBottom: '8px', padding: '20rpx 0'}" :label="item.name" :name="item.name">
				</u-radio>
			</view>
		</u-radio-group>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				radiolist1: [{
						name: '中文',
						disabled: false
					},
					{
						name: 'にほんご',
						disabled: false
					},
					{
						name: 'English',
						disabled: false
					}, {
						name: 'Français',
						disabled: false
					}
				],
				radiovalue1: '中文',
			};
		},
		methods: {
			groupChange(n) {
				console.log('groupChange', n);
			},
			radioChange(n) {
				console.log('radioChange', n);
			},
			changeRadio(index) {
				console.log('changeRadio triggered', index);
				const item = this.radiolist1[index];
				this.radiovalue1 = item.name
			}
		}
	};
</script>

<style scoped lang="scss">
	.content {
		padding: 20rpx 30rpx;
		background: #fff;
		margin: 20rpx;
		border-radius: 28rpx;
	}
	
	.item {
		cursor: pointer;
		&:not(:last-child) {
			border-bottom: 1rpx solid #eee;
		}
		
		&:not(:first-child) {
			margin-top: 20rpx;
		}
	}
</style>